Skip to content

Fix #95: Add BinPacking model#96

Open
GiggleLiu wants to merge 6 commits intomainfrom
issue-95-bin-packing
Open

Fix #95: Add BinPacking model#96
GiggleLiu wants to merge 6 commits intomainfrom
issue-95-bin-packing

Conversation

@GiggleLiu
Copy link
Contributor

Summary

  • Add BinPacking<W> optimization model to src/models/optimization/
  • Minimizes number of bins used for items with sizes subject to capacity constraints
  • Config space: each of n items assigned to one of n possible bins
  • Parameterized by weight type W (i32, f64) for item sizes

Closes #95

Plan

See docs/plans/2026-02-25-bin-packing.md for the full implementation plan covering:

  1. Model implementation (BinPacking<W> struct + Problem/OptimizationProblem traits)
  2. Unit tests (creation, evaluation, brute-force solver, serialization)
  3. CLI dispatch registration
  4. Paper documentation (#problem-def)

Test plan

  • Unit tests for creation, evaluation (valid/invalid), direction, serialization
  • Brute-force solver finds optimal solution on example instance (6 items, capacity 10)
  • CLI can load/solve/serialize BinPacking instances
  • make check passes (fmt + clippy + test)
  • Paper builds with new problem definition

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 91.36691% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.33%. Comparing base (9671215) to head (252eee8).

Files with missing lines Patch % Lines
src/models/optimization/bin_packing.rs 81.66% 11 Missing ⚠️
...t_tests/rules/unitdiskmapping/pathdecomposition.rs 92.85% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (91.36%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #96      +/-   ##
==========================================
- Coverage   96.36%   96.33%   -0.03%     
==========================================
  Files         197      199       +2     
  Lines       27214    27352     +138     
==========================================
+ Hits        26224    26349     +125     
- Misses        990     1003      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

GiggleLiu and others added 5 commits February 25, 2026 10:35
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Also fix pub(crate) -> mod consistency in optimization/mod.rs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Model] BinPacking

1 participant